package main

import "fmt"

func main() {
	a := 100
	switch /*看不见的布尔值，默认为 true*/ {
	case a > 0:
		fmt.Println("a is positive")
	case a < 0:
		fmt.Println("a is negative")
	case a == 0:
		fmt.Println("a is zero")
	}
	switch a { // switch后面是 int
	case 0: // a == 0
		fmt.Println("zero")
	case 10:
		fmt.Println(100, 10, 1000)
	case 100:
		fmt.Println(100)
	default:
		fmt.Println("以上都不是")
	}

	switch a { // switch后面是 int
	case 0: // a == 0
		fmt.Println("zero")
	case 10:
		fmt.Println(100, 10, 1000)
	case 100:
		// fmt.Println(100)
		fallthrough // 这里没有break，继续执行下一个case
	case 1000:
		fmt.Println("10的倍数", a)
	default:
		fmt.Println("以上都不是")
	}

	switch b := 100; {
	case b > 0:
		fmt.Println("b is positive")
	case b < 0:
		fmt.Println("b is negative")
	case b == 0:
		fmt.Println("b is zero")
	}

}
